<?php
namespace app\modules\frontend\controllers;

use Yii;
use app\models\Product;
use yii\data\SqlDataProvider;
use yii\web\Controller;
use app\models\ProductAuth;
use yii\web\Pjax;

class AutheticController extends Controller{

    public function actionIndex($id) //将产品的id传到认证信息表中 找出多组数据 然后显示出来
    {

        $this->layout='product';



        $sql="select * from shbb_product_auth where product_id=$id";

        $models=ProductAuth::findBySql($sql)->all();
        //在批次表中查找属于该产品id的批次

        return $this->render('index',['models'=> $models]); //将数据源传给index视图
    }


}